<html xmlns:th="http://www.thymeleaf.org">
<html>
<head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <title>任务信息</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
    <link href="../../../../static/easyui/themes/insdep/easyui.css" rel="stylesheet" type="text/css">
    <link href="../../../../static/easyui/themes/insdep/easyui_animation.css" rel="stylesheet" type="text/css">
    <link href="../../../../static/easyui/themes/insdep/easyui_plus.css" rel="stylesheet" type="text/css">
    <link href="../../../../static/easyui/themes/insdep/insdep_theme_default.css" rel="stylesheet" type="text/css">
    <link href="../../../../static/easyui/themes/insdep/icon.css" rel="stylesheet" type="text/css">
    <link href="../../../../static/easyui/themes/color.css" rel="stylesheet" type="text/css">
    <link href="../../../../static/ztree/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css">
    <link href="../../../../static/css/common.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="../../../../static/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="../../../../static/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../../../static/easyui/themes/insdep/jquery.insdep-extend.min.js"></script>
    <script type="text/javascript" src="../../../../static/ztree/jquery.ztree.all.min.js"></script>
    <script type="text/javascript" src="../../../../static/easyui/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="../../../../static/kindeditor/kindeditor-all-min.js"></script>
</head>

<body>
<div>
    <select id="op" name="taskVo" class="easyui-combobox theme-textbox-radius" style="width:120px">
        <option value="1">任意字段</option>
        <option value="subject" >主题</option>
        <option value="tsu2.username" >创建者</option>
        <option value="tsu.username">负责人</option>
        <option value="status">任务状态</option>
        <option value="priority">优先级</option>
        <option value="description">描述</option>
        <option value="duedate">截止日期</option>
        <option value="createDate">创建日期</option>
        <option value="updateDate">更行日期</option>
    </select>
    <input name="subject" type="text" class="easyui-textbox theme-textbox-radius" placeholder="默认按主题搜索" style="width: 150px"/>
    <a href="javascript:void(0);" onclick="return searchs()" class="easyui-linkbutton"
       data-options="iconCls:'icon-search'">搜索</a>
</div>

<table id="taskList" class="easyui-datagrid" width="100%">

</table>
</body>
<script type="text/javascript">
    // 搜索
    function searchs() {
        var asd=$("#op").val()
        $("#taskList").datagrid("load", {
            "subject": $("input[name=subject]").val(),
            "asd": asd
        })
    }
    $(function () {
        $("#taskList").datagrid({
            url: "/manage/task/index_tow_TaskAction_findByPage.action",
            pagination: true,
            toolbar: "#toolbar",
            fitColumns: true,
            idField: "taskid",
            rownumbers: true,
            columns: [
                [
                {field: "id", title: "选择", checkbox: true},
                {field: "subject", title: "主题", width: 12},
                {field: "aboutUsers", title: "相关人", width: 12},
                {field: "priority", title: "优先级", width: 12},
                {field: "name", title: "负责人", width: 12,
                        formatter:function (value,rowData,index){
                            return  rowData.tbSystemUser.username;
                        }
                    },
                {field: "username", title: "创建者", width: 12,
                    formatter:function (value,rowData,index){
                        return  rowData.tbSystemUser2.username;
                    }
                },
                {field: "dueDate", title: "截止日期", width: 15},
                {field: "status", title: "状态", width: 12},
                {
                    field: "operation", title: "操作",width: 10, formatter: function (value, rowData, index) {
                        return " "+"<a href='javascript:void(0);' onclick='see(" + index + ")'>查 看</a>" +" "
                    }
                },
            ]
            ],
            loadFilter: function (data) {
                return {"total": data.totalRows, "rows": data.result}
            }
        });
    });
    function see(index) {
        $("#taskList").datagrid("selectRow", index);
        var row = $("#taskList").datagrid("getSelected");
        var id = row.id;
        parent.openTopWindow({
            width: 500,
            height: 700,
            title: "查看",
            url: "/manage/task/TaskAction_see.action?id=" + id,
            close: function () {
                $("#taskList").datagrid("reload")
            }
        })

    }
</script>
</html>
